package com.kaiwukj.android.ufamily.mvp.ui.page.order;

import com.kaiwukj.android.mcas.mvp.IModel;
import com.kaiwukj.android.mcas.mvp.IView;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.ListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.OrderCreateParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.OrderEvaluateParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.OrderPayParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.OrderRefundParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.HouseKeeperResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyAddressResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderCreateResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderDetailResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderEvaluateResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderResult;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

public interface OrderContract {

    interface View extends IView {

        void onFetchOrder(List<OrderResult> results);

        void onGetOrder(OrderDetailResult result);

        void onOrderPayResult(Map<String, Object> result);

        void onGetHouseKeeper(HouseKeeperResult result);
    }

    interface EvaluateView extends IView {
        void onFetchResult(List<OrderEvaluateResult> results);
    }

    interface OrderCreateView extends IView {
        void onOrderCreateResult(OrderCreateResult result);

        void onOrderPayResult(Map<String, Object> result);

        void onFetchDefAddress(MyAddressResult result);
    }

    interface Model extends IModel {
        /**
         * 获取订单评价
         *
         * @param page     page
         * @param pageSize pageSize
         * @param type     1:未评价 2:已评价
         * @return List<OrderEvaluateResult>
         */
        Observable<ListResp<OrderEvaluateResult>> fetchEvaluate(int page, int pageSize, int type);

        /**
         * 获取订单
         *
         * @param page     page
         * @param pageSize pageSize
         * @param status   -1:全部　0：未支付 1：接单中 2：待服务 3：服务中 4：已完成 6:已取消
         * @return List<OrderResult>
         */
        Observable<ListResp<OrderResult>> fetchOrder(int page, int pageSize, int status);

        Observable<Integer> addEvaluate(OrderEvaluateParams params);

        Observable<OrderDetailResult> getOrderById(int id);

        Observable<ListResp<MyAddressResult>> fetchMyAddress(int page, int pageSize);

        Observable<OrderCreateResult> createOrder(OrderCreateParams params);

        Observable<Map<String, Object>> payOrder(OrderPayParams payParams);

        Observable<Integer> cancelOrder(int orderId);

        Observable<Integer> deleteOrder(int orderId);

        Observable<Integer> refundOrder(OrderRefundParams params);

        Observable<Integer> cancelRefund(int orderId);

        Observable<String> getQINiuToken();

        Observable<HouseKeeperResult> getHouseKeeperResult();

    }

}
